package com.lin.filebeanfactory;

import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MainApp {
	public static void main(String[] args) {
//		ApplicationContext context = new FileSystemXmlApplicationContext("D:/StudyProject/Demo/HelloSpring/src/Beans.xml");
//		HelloWord bean = (HelloWord) context.getBean("helloWorld");
//		bean.setMessage("I am is bean");
//		bean.getMessage();
//		HelloWord bean1 = (HelloWord) context.getBean("helloWorld");
//		bean1.getMessage();
		AbstractApplicationContext context = new ClassPathXmlApplicationContext("Beans.xml");
		HelloWord bean = (HelloWord) context.getBean("helloWorld");
		bean.getMessage();
		context.registerShutdownHook();
		
	}

}
